home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 17
/
AMIGAplus Sonderheft 17 (1999)(ICP)(DE)[!].iso
/
PD
/
Anwendungen
/
-DataTypes-
/
mpegsystem
/
mpegsystem.datatype.doc
< prev
next >
Wrap
Text File
|
1998-06-17
|
19KB
|
496 lines
TABLE OF CONTENTS
mpegsystem.datatype/--datasheed--
mpegsystem.datatype/--input_format--
mpegsystem.datatype/ADTM_LOADFRAME
mpegsystem.datatype/ADTM_UNLOADFRAME
mpegsystem.datatype/DTM_WRITE
mpegsystem.datatype/MAIN
mpegsystem.datatype/OM_DISPOSE
mpegsystem.datatype/OM_NEW
mpegsystem.datatype/preferences
mpegsystem.datatype/--datasheed-- mpegsystem.datatype/--datasheed--
NAME
mpegsystem.datatype -- data type for MPEG System streams
SUPERCLASS
animation.datatype
DESCRIPTION
The anim datatype, a sub-class of the animation.datatype, is used to
load and play MPEG System movies.
METHODS
OM_NEW -- Create a new animation object from a description file. The
source may only be a file.
OM_DISPOSE -- Dispose instance and contents (embedded objects etc.
etc.), then pass msg to superclass
OM_UPDATE -- Perform an ICM_CHECKLOOP check, and if succesfull, the
method will be executed like OM_SET downstairs.
OM_SET -- Pass msg to superclass and call GM_RENDER if retval from
superclass was != 0UL.
DTM_WRITE -- Save object's contents in local (MPEG System) or
superclass (IFF ILBM) format.
NOT IMPLEMENTED YET
ADTM_LOADFRAME -- Fill in struct adtFrame with requested information
from embedded objects like bitmap, colormap and sample.
ADTM_UNLOADFRAME -- Free resources obtained by ADTM_UNLOADFRAME.
The method is passed to the embedded objects.
All other methods are passed unchanged to superclass.
ATTRIBUTES
Following attributes are set by the object and are READ-ONLY for
applications:
BUGS
- Support for streams with multiple video- and/or audio-streams
has been removed. The datatype uses currently evertimes
the first video- and the first audio-stream it finds.
- ADTM_START, ADT_PAUSE, ADTM_STOP and ADTM_LOCATE are not passed
to the embedded mpevideo.datatype object(s), which may cause
speed loss if this datatype does speed optimisations based on use
of those methods.
- The sound may be out-of-sync in the case that a stream
is very long (more than 60 minutes) due rounding problems.
(In theory it should not occur - and I did not see the bug...).
TODO
- Fixing the bugs above.
- Write the "--input_format--"-Autodoc section.
- Leading zeros in the beginning of the file except the "start code"
begin sequence causes a stream not to be recognized by
datatypes.library.
May happen if someone reads raw data from a VideoCD.
- Writing the encoder part, using mpegvideo.datatype V2's encoder
and mpegaudio.datatype's encoder parts.
Coming soon... :-)
- Implementation of ACTION_INFO in the internal filesystem that
(in theory) optimized reading using async I/O gets correct
parameters.
- Support for MPEG 2 system streams.
- QUICKSCAN option for optimized and much faster scanning of system
streams.
HISTORY
V1.1
First public release.
V1.2
- Fixed the descriptor (e.g. the file "MPEG System"). The
old one contains unneccesary data in the comparisation mask.
Now the descriptor matches the standard, except that
leading zero bytes (0x00) causes that the stream won't be
identified.
Thanks to Steve Cutting (stevejc@c031aone.net.au) for reporting
the bug.
Fixed.
- Implemented IGNOREERRORS switch to get Steve Cutting's
(stevejc@c031aone.net.au) example file
"http://www.utexas.edustudents/cjso/Chabad/video/chase.mpg"
working.
- Added missing VERBOSESYNTAX and DEBUG options to find problems
in the datatype without recompiling the complete source.
- Fixed a bug in the FS:
The internal filesystem now returns ERROR_SEEK_ERROR of someone
send an ACTION_SEEK with an unknown position mode
(e.g. if it is none of OFFSET_(BEGINNING|CURRENT|END)).
Fixed.
- Fixed some problems with the VERBOSE and DEBUG output (missing
newlines, single lines > 75 chars etc.).
Fixed.
V1.3
- Minor code cleanup
- Fixed and updated the autodoc.
- Increased the handlers process priority up to 9
(normal FFS tasks are running at priority 10) to get more speed
during scanning.
V1.4
- Added asyncio.library support code (but it does not work yet...).
- Implemented ACTION_COPY_DIR_FH to get DupLockFromFH working which
is used in the new mpegaudio.datatype V2 (currently this feature
is not used because of some problems with mpega.library, but...).
- Fixed a bug in OM_NEWs state machine which caused big problems
if an error occurs with IoErr() == 0.
Fixed.
V1.5
- Removed non-working asyncio.library support code.
- Implemented my own "async" dos packet system, which is more
efficient than asyncio.library's one (in our case !).
- Added/removed/moved some code to get rid of a "Seek" in the
scan phase.
- Added some usefull comments.
- Moved preferences support code into "prefs.c".
- Implemented NOVERBOSE option as requested by many people.
- Increased handlers priority to 15 and renamed the hander's
process.
SEE ALSO
animation.datatype,
anim.datatype,
gifanim.datatype,
mpegvideo.datatype, mpegaudio.datatype,
picmovie.datatype,
cdxl.datatype, avi.datatype, quicktime.datatype,
moviesetter.datatype,
film.datatype,
directory.datatype,
markabletextdtclass
mpegsystem.datatype/--input_format-- mpegsystem.datatype/--input_format--
NAME
MPEG System -- MPEG System stream format
DESCRIPTION
<Not written yet, sorry>
SEE ALSO
mpegsystem.datatype/ADTM_LOADFRAME mpegsystem.datatype/ADTM_LOADFRAME
NAME
ADTM_LOADFRAME -- Load frame
FUNCTION
The ADTM_LOADFRAME method is used to obtain the bitmap and timing
data of the animation.
The method is passed to the embedded mpegvideo.datatype object.
If successfull, the sample data of struct adtFrame are replaced
by the corresponsing audio data from the embedded
mpegaudio.datatype object.
RESULT
Returns the result from the embedded mpegvideo.datatype object
(including Result2).
mpegsystem.datatype/ADTM_UNLOADFRAME mpegsystem.datatype/ADTM_UNLOADFRAME
NAME
ADTM_UNLOADFRAME -- Unload frame contents
FUNCTION
The ADTM_UNLOADFRAME method is used to release the contents of a
animation frame.
This method is passed to the embedded mpegvideo.datatype object.
RESULT
Returns the result from the embedded mpegvideo.datatype object.
mpegsystem.datatype/DTM_WRITE mpegsystem.datatype/DTM_WRITE
NAME
DTM_WRITE -- Save data
FUNCTION
This method saves the object's contents to disk.
If dtw_Mode is DTWM_IFF, the method is passed unchanged to the
superclass, animation.datatype, which writes a single IFF ILBM
picture.
If dtw_mode is DTWM_RAW, the object saved an MPEG System stream to
the filehandle given, starting with the current frame until
the end is reached.
The sequence saved can be controlled by the ADTA_Frame, ADTA_Frames
and ADTA_FrameIncrement attributes (see TAGS section below).
TAGS
When writing the local ("raw") format, MPEG System movie, the
following attributes are recognized:
ADTA_Frame (ULONG) - start frame, saving starts here.
Defaults to the current frame displayed.
ADTA_Frames (ULONG) - the number of frames to be saved,
Defaults to (max_num_of_frames - curr_frame).
ADTA_FrameIncrement (ULONG) - frame increment when saving.
Defaults to 1, which means: "jump to next frame".
NOTE
This function is not implemented yet. A possible implementation
would implement ACTION_WRITE in the virtial implementation and uses
mpegvideo.datatype and mpegaudio.datatype encoders...
RESULT
Returns 0 for failure (IoErr() returns result2), non-zero
for success.
mpegsystem.datatype/MAIN mpegsystem.datatype/MAIN
INTRODUCTION
Datatypes class for MPEG 1 System movies (including VideCD streams)
REQUIREMENTS
- You need at least Kick/WB 3.0.
- datatypes.library >= V45
- "datatypes/animation.datatype", >= V40.
"animation.datatype 40.6 (28.09.93)" requires itself some
libraries/boopsi classes:
- "realtime.library", >= V39 - for timing
- "gadgets/tapedeck.gadget" (any version) - for the controls
- mpegvideo.datatype >= V1.6 (V2.x preferred)
- mpegaudio.datatype >= V1.1
USAGE
If the datatypes descriptor file was activated, any attempt to load
a MPEG System stream using GMultiView, MultiView, AmigaGuide or
SwitchWindow will load and play the movie.
INSTALLATION
After unpacking this archive:
Because this version does not include an Installer script, you have
to do the installation manually through the shell:
- Unpack this archive and copy the "mpegsystem.datatype" to
SYS:Classes/DataTypes/:
Copy CLONE FROM "mpegsystem.datatype" TO
"SYS:Classes/DataTypes/mpegsystem.datatype"
- Then copy the datatypes descriptor into the DEVS:DataTypes
directory.
If the descriptor already exists, you should not replace it,
otherwise you may loose "toolnodes" and other settings stored in
the existing descriptor.
Copy CLONE FROM "MPEG System(%|.info)" TO DEVS:Datatypes/
SOURCE
Source is included as an example how to write a datatypes clas
implements a virtual filesystem and embeds other datatype objects
for it's work.
MODEL
This datatype uses a very complex model for decoding MPEG system
streams. The small drawing below shows the model (OK, the
drawing is not very good, it's incomplete and so on. If someone
has the time to draw a better one, send it to me).
system stream
|
|
Y
+-------------------------------------------------------------+
| mpeg system datatype |
+-----------------------------------------+-------------------+
| demultiplexer | ADTM_LOADFRAME |
| video 0...video n | audio 0... audio n | ADTM_UNLOADFRAME |
+-----+-------+------+------+-------+-----+-------------------+
| | | | ^ ^
| | | | | |
| * | * | |
| | | |
| | | |
Y Y | |
+---------------------+ +---------------------+ | |
| mpeg video datatype | | mpeg audio datatype | | |
+-----------+---------+ +--------+------------+ | |
| | | |
| | | |
| +-----------------------+ |
+------------------------------------------------+
AUTHOR
If you want to blame me, report any bugs, or wants a new version
send your letter to:
Roland Mainz
Hohenstaufenstraße 8
52388 Nörvenich
GERMANY
Phone: (+49)(0)2426/901568
Fax: (+49)(0)2426/901569
EMAIL is also available (if you want to send me attachments
larger than 1MB (up to 5MB, more with my permission):
GISBURN@w-specht.rhein-ruhr.de
Up to August 1998 I'm reachable using this email address, too:
Reinhold.A.Mainz@KBV.DE
| Please put your name and address in your mails !
| German mailers should add their phone numbers.
| See BUGS section above when submitting bug reports.
Sorry, but I can only look once a week for mails.
If you don't hear something from me within three weeks, please
send your mail again (but watch about new releases) (problems with
this email port are caused by reconfigurations, hackers, network
problems etc.).
The entire "mpegsystem.datatype" package may be noncommercially
redistributed, provided that the package is always distributed
in it's complete form (including it's documentation). A small
copy fee for media costs is okay but any kind of commercial
distribution is strictly forbidden without my permission !
Comments and suggestions how to improve this program are
generally appreciated!
Thanks to David Junod, who wrote the animation.datatype and lots of
the datatypes example code, Matt Dillon for his DICE,
Olaf 'Olsen' Barthel for his help, ideas and some text clips from
his documentations.
mpegsystem.datatype/OM_DISPOSE mpegsystem.datatype/OM_DISPOSE
NAME
OM_DISPOSE -- Delete a mpegsystem.datatype object.
FUNCTION
The OM_DISPOSE method is used to delete an instance of the
mpegsystem.datatype class. This method is passed to the superclass
when it has completed.
RESULT
The object is deleted. 0UL is returned.
mpegsystem.datatype/OM_NEW mpegsystem.datatype/OM_NEW
NAME
OM_NEW -- Create a mpegsystem.datatype object.
FUNCTION
The OM_NEW method is used to create an instance of the
mpegsystem.datatype class. This method is passed to the superclass
first. After this, mpegsystem.datatype parses the prefs file and
makes a scan through the system stream to get index information
about the single system stream packets.
After all, the mpegsystem.datatype starts two objects which reads
the single video and audio streams trougth an internal
"demultiplexer" (system stream splitter) filesystem.
Subclasses of mpegsystem.datatype are not supported. Any attempt to
create a subclass object of mpegsystem.datatype will be rejected by
this method.
ATTRIBUTES
The following attributes can be specified at creation time.
DTA_SourceType (ULONG) -- Determinates the type of DTA_Handle
attribute. Only DTST_FILE is supported.
If any other type was set in a given DTA_SourceType,
OM_NEW will be rejected.
Defaults to DTST_FILE.
DTA_Handle -- For DTST_FILE, a BPTR filehandle is expected. This
handle will be created by datatypesclass depeding on the DTF_#?
flag, which is DTF_BINARY here. DTST_FILE, datatypesclass
creates a file handle from the given DTA_Name and DTA_Handle
(a BPTR returned by Lock).
A DTST_RAM (create empty object) source type requires a NULL
handle.
RESULT
If the object was created a pointer to the object is returned,
otherwise NULL is returned.
mpegsystem.datatype/preferences mpegsystem.datatype/preferences
NAME
preferences
DESCRIPTION
The "ENV:Classes/DataTypes/mpegsystem.prefs" file contains global
settings for the datatype.
The preferences file is an ASCII file containing one line where the
preferences can be set.
It can be superset by a local variable with the same name.
Each line can contain settings, special settings for some projects
can be set using the MATCHPROJECT option.
Lines beginning with a '#' or ';' chars are treated as comments.
Lines are limitted to 256 chars.
TEMPLATE
MATCHPROJECT/K,VERBOSE/S,NOVERBOSE/S,VERBOSESYNTAX/S,
NOVERBOSESYNTAX/S,VERBOSEDEBUG=DEBUG/S,NOVERBOSEDEBUG=NODEBUG/S,
IGNOREERRORS/S,NOIGNOREERRORS/S
MATCHPROJECT -- The settings in this line belongs only to this
project(s), e.g. if the case-insensitive pattern does not match,
this line is ignored.
The maximum length of the pattern is 128 chars.
Defaults to #?, which matches any project.
VERBOSE -- Print information about the animation. Currently
the frame numbers and the used compression are printed, after all
number of scanned/loaded frames, set FPS rate, dimensions (width/
height/depth), sample information etc.
NOVERBOSE -- Turns VERBOSE mode off.
Be _carefull_ with this options, this turns really ALL error
messages OFF !
VERBOSESYNTAX -- Print information about syntax errors
NOVERBOSESYNTAX -- Turns the VERBOSESYNTAX option off.
DEBUG
VERBOSEDEBUG -- Turns debugging mode on to get internal debugging
info without recompiling the whole source.
NODEBUG
NOVERBOSEDEBUG -- Turns the DEBUG option off.
IGNOREERRORS -- Ignores errors if system stream parsing fails;
the video+audio parts attempts to load the data until the
last scanned packet occurs.
NOIGNOREERRORS -- Turns the IGNOREERRORS option off.
NOTE
- An invalid prefs file line will be ignored and forces the VERBOSE
output.
BUGS
- Low memory may cause that the prefs file won't be parsed.
- Lines are limitted to 256 chars
- An invalid prefs file line will be ignored.
- The sample path length is limitted to 200 chars. A larger
value may crash the machine if an error occurs.